package com.ruoyi.order.service.impl;

import java.math.BigDecimal;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.OrderFormMapper;
import com.ruoyi.order.domain.OrderForm;
import com.ruoyi.order.service.IOrderFormService;

/**
 * 订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-09
 */
@Service
public class OrderFormServiceImpl implements IOrderFormService 
{
    @Autowired
    private OrderFormMapper orderFormMapper;

    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public OrderForm selectOrderFormByOrderId(Long orderId)
    {
        return orderFormMapper.selectOrderFormByOrderId(orderId);
    }

    /**
     * 查询订单列表
     * 
     * @param orderForm 订单
     * @return 订单
     */
    @Override
    public List<OrderForm> selectOrderFormList(OrderForm orderForm)
    {
        return orderFormMapper.selectOrderFormList(orderForm);
    }

    /**
     * 新增订单
     * 
     * @param orderForm 订单
     * @return 结果
     */
    @Override
    public int insertOrderForm(OrderForm orderForm)
    {
        return orderFormMapper.insertOrderForm(orderForm);
    }

    /**
     * 修改订单
     * 
     * @param orderForm 订单
     * @return 结果
     */
    @Override
    public int updateOrderForm(OrderForm orderForm)
    {
        orderForm.setOrderMoney(BigDecimal.valueOf(20L));
        return orderFormMapper.updateOrderForm(orderForm);
    }

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteOrderFormByOrderIds(Long[] orderIds)
    {

        return orderFormMapper.deleteOrderFormByOrderIds(orderIds);
    }

    /**
     * 删除订单信息
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    @Override
    public int deleteOrderFormByOrderId(Long orderId)
    {
        return orderFormMapper.deleteOrderFormByOrderId(orderId);
    }
}
